vcNavAgent

A navigation agent that can navigate within the navigation mesh defined by vcNavUnit. Navigation agents can be instructed to automatically or manually steer to target positions. When steered automatically, the agent will compute a path and follow it to the target while avoiding other agents. When steered manually, the agent will attempt to move directly toward the target position without pathfinding or avoidance.

See in: Overview

Module: vcCore

Parent: vcObject

Children -

Referenced by: vcNavUnit.Agents, vcNavUnit.createAgent()

Properties

Learn how to use properties here. The properties are also inherited from the parent class.

NameTypeAccessDescription
AvoidanceQualityvcAvoidanceQualityRWGets or sets the avoidance quality setting for the agent. The higher the quality the higher the CPU depand but improved avoidance behavior in dense crowds.
CollisionQueryRangeRealRWGets or sets the collision query range of the agent [mm].
CornerAssistWeightRealRWGets or sets a slow down multiplier how agressively the agent will slow down when cornering.
Must be positive value. Default is 1.0.
DeadLockTimeoutRealRWGets or sets time in seconds to consider the agent is in deadlock and when the event is raised. Defaults to 15.0 s.
HeightRealRWGets or sets the height of the navigation agent [mm].
IsAtTargetBooleanRGets whether the agent has reached its target or has no target.
MaxAccelerationRealRWGets or sets the maximum acceleration of the agent [mm/s^2].
MaxAngularAccelerationRealRWGets or sets the maximum angular acceleration of the agent [deg/s^2]. Used by manual steering.
MaxAngularVelocityRealRWGets or sets the maximum angular velocity of the agent [deg/s].
MaxVelocityRealRWGets or sets the maximum velocity of the agent [mm/s].
PathCornerslist[vcVector]RGets the current path corners of the navigation agent.
ProximityAssistWeightRealRWGets or sets a slow down multiplier how agressively the agent will slow down if another slower
nearby agent is in the front sector of this agent. Valid range [0...1]. Default is 1.0.
RadiusRealRWGets or sets the radius of the navigation agent [mm].
SeparationWeightRealRWGets or sets the separation weight of the agent.
TurnInPlaceThresholdRealRWGets or sets the turn-in-place threshold angle [degrees].
See more
The threshold determines the angle which requires turning in place before starting auto steer movement.
VelocityRealRGets the current velocity [mm/s].

Methods

Learn how to use methods here. The methods are also inherited from the parent class.

NameReturn TypeParametersDescription
autoSteerToBooleanvcVector position,
Optional Keyword[heading = Real]
Automatically navigates and steers the agent to the specified position.
See more
Parameters:
position (vcVector): The target position to steer the agent to.
heading (float | None): The final heading angle to orient the agent. None to ignore heading.
Returns:
bool: A boolean value indicating whether the operation was started successfully.
deleteNoneNoneRemoves the navigation agent from the simulation.
See more
The agent will be removed immediately and cannot be used after this call.
Parameters:
None
Returns:
None
Exceptions:
TypeError: Internal error.
manualSteerToBooleanvcVector position,
Optional Keyword[heading = Real]
Manually steers the agent toward the specified position and final heading.
See more
Parameters:
position (vcVector): The target position to steer the agent to.
heading (float | None): The final heading angle to orient the agent. None to keep current heading.
Returns:
bool: A boolean value indicating whether the operation was started successfully.

Events

Learn how to use events here. The events are also inherited from the parent class.

NameParametersDescription
OnAreaCrossingvcNavAgent agent,
int | None fromId,
int | None toId
Event triggered when a navigation agent is about to cross an area boundary.
See more
Parameters:
agent (vcNavAgent): The navigation agent instance that is crossing an area.
fromId (int | None): The ID of the restricted area being exited, or None if not applicable.
toId (int | None): The ID of the restricted area being entered, or None if not applicable.
OnDeadLockvcNavAgent agentEvent triggered when a navigation agent is stuck. Typically blocked by other agents.
Parameters:
agent (vcNavAgent): The navigation agent instance that is in a deadlock.
OnTargetReachedvcNavAgent agentEvent triggered when a navigation agent reaches its target.
Parameters:
agent (vcNavAgent): The navigation agent instance that reached its target.